import axios from 'axios'

export const increase=()=>{
    return {
        type: 'INCREASE'
    }
}
export const increase2=(data)=>{
    return {
        type: 'INCREASE2',
        payload:data
    }
}
export const setzero=()=>{
    return {
        type: 'SETZERO',
    }
}

export const getdetail=(data)=>{
    //console.log(data)
    return {
        type: 'GETDETAIL',
        payload:data
    }
}

export const getDetail=(id)=>{
    return (dispatch)=>{
        const url=`http://129.211.16.185:3000/product?id=${id}`
        /* const url=`http://203.195.241.213/product?id=${id}` */
        axios({
            url:url,
            method:"get"
        }).then(res=>{
            dispatch(getdetail(res.data));
        })
    }
    
}